package com.zsummer.baikal.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zsummer.baikal.system.dto.SysUserDTO;
import com.zsummer.baikal.system.entity.SysUser;
import com.zsummer.baikal.system.mapper.SysUserMapper;
import com.zsummer.baikal.system.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zsummer.baikal.system.vo.SysUserVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户表 服务实现类
 * @author zsummer
 * @since 2021-07-28
 */
@Service
@RequiredArgsConstructor
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    private final SysUserMapper sysUserMapper;

    /**
     * 分页查询用户列表
     * @param page
     * @param searchDTO
     * @return
     */
    @Override
    public IPage<SysUserVO> searchUser(Page page, SysUserDTO searchDTO) {
        return sysUserMapper.searchUser(page, searchDTO);
    }

    @Override
    public SysUser getUserVoById(Long id) {
        return sysUserMapper.getUserVoById(id);
    }
}
